import request from '@/utils/request.js'


const prefix = '/api/coach'

// 教练列表
export function coachList(params) {
	return request({
		url: prefix + '/list',
		method: 'get',
		params: params
	})
}

// 获取教练信息
export function coachInfo(id) {
	return request({
		url: prefix + '/info/' + id,
		method: 'get'
	})
}
// 教练评价列表
export function coachEvaluateList(id) {
	return request({
		url: prefix + '/evaluate/'+ id,
		method: 'get',
	})
}
//关注
export function addInterest(coachId) {
	return request({
		url: prefix + '/interest/' + coachId,
		method: 'post'
	})
}
//取消关注
export function cancelInterest(coachId) {
	return request({
		url: prefix + '/delInterest/' + coachId,
		method: 'delete'
	})
}
//教练入驻
export function joinCoach(data) {
	return request({
		url: prefix + '/enterCoach' ,
		method: 'post',
		data: data
	})
}
/**
 * 教练评价
 * @param {Object} data
 */
export function addEvaluate(data) {
	return request({
		url: prefix + '/addEvaluate' ,
		method: 'post',
		data: data
	})
}
/**
 * 更新教练信息
 * @param {Object} 
 */
export function updateCoach(data) {
	return request({
		url: prefix + '/updateCoach' ,
		method: 'post',
		data: data
	})
}

/**
 * 用户ID获取教练信息
 */
export function coachInfoByUserId() {
	return request({
		url: prefix + '/coachInfo',
		method: 'get'
	})
}